/*
*    Phantom v2.0 GUI Automation Software
*    Copyright (C) 2009  John C. Van Arsdall (john@phantomtest.com)
*
*    This program is free software; you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation; either version 2 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License along
*    with this program; if not, write to the Free Software Foundation, Inc.,
*    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#pragma once
#include "SSI_ScriptAPI.h"
#include "ClassWindow.h"

#define SSI_JAVA_API __declspec(dllexport)

extern "C"
{
	void SSI_JAVA_API RegisterFunctions(CEngine* anEngine);
	void SSI_JAVA_API StandardFunctionProcessor(SSI_FunctionAPI& theAPI);
	void SSI_JAVA_API CleanUp(CEngine* anEngine);
}

#ifndef __DATANODE
typedef struct WinDataT* DataNode;
#define __DATANODE
#endif //__DATANODE

#ifndef __WINDATAT
#define __WINDATAT
struct WinDataT{
	String* WinName;
	String* WinTag;
	String* WinClass;
	String* WinType;
	int iWinTag;
	int IsParent;
	int IsChild;
	DataNode Next;
	DataNode Prev;
	DataNode Parent;
	DataNode FChild;
};
#endif //__WINDATAT


class SSI_JAVA_API CDataJavaWindow :
	public CDataWindow
{
public:
	CDataJavaWindow(void);
	~CDataJavaWindow(void);

private:
	static SSI_INT64 sType;
private:
	virtual CData* MakeData(void);
	virtual SSI_BOOL CopyData(CData* Other);
public:
	virtual SSI_BOOL DeleteData(CData* In);  // Not pure yet, but still must be made pure
	virtual SSI_INT64 Register(SSI_INT64 NewType);
	virtual void UnRegister();
	virtual SSI_BOOL boolean();
	virtual CStatus InitData(void);

	virtual void SSI_FunctionProcessor(SSI_FunctionAPI& theAPI);
	static SSI_INT64 GetRegisteredType(void);

  virtual void DisplayMembers(ssi_stream* out);
	virtual void LoadFunctions(String& Funcs);
	virtual SSI_INT64 PrimitiveFromType(String& Class);
	virtual CStatus EvalFunction(VarItor TopVar, VarTree& InTree, CStatement& aStat);
	virtual SSI_BOOL IsFunction(const String& fName);

protected:
	CFunctionSet LocFuncSet;
	
};

void DelDataNodeTree(DataNode winNode);
DataNode CopyPath(DataNode Original);
DataNode GetFreshNode(DataNode Ret);
